package com.zj.fx.model.rpa;

import cn.hutool.core.util.StrUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * 供电可靠率供电所名称对应关系表 RpaMidSupplyExample
 *
 * @author SQL_自动生成
 * @date 2023-11-20 16:58:46
 */
public class RpaMidSupplyExample {

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public RpaMidSupplyExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }


        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(String value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(String value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(String value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(String value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(String value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(String value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLike(String value) {
            addCriterion("id like", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotLike(String value) {
            addCriterion("id not like", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<String> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<String> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(String value1, String value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(String value1, String value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }


        public Criteria andSupplyidIsNull() {
            addCriterion("supplyid is null");
            return (Criteria) this;
        }

        public Criteria andSupplyidIsNotNull() {
            addCriterion("supplyid is not null");
            return (Criteria) this;
        }

        public Criteria andSupplyidEqualTo(String value) {
            addCriterion("supplyid =", value, "supplyid");
            return (Criteria) this;
        }

        public Criteria andSupplyidNotEqualTo(String value) {
            addCriterion("supplyid <>", value, "supplyid");
            return (Criteria) this;
        }

        public Criteria andSupplyidGreaterThan(String value) {
            addCriterion("supplyid >", value, "supplyid");
            return (Criteria) this;
        }

        public Criteria andSupplyidGreaterThanOrEqualTo(String value) {
            addCriterion("supplyid >=", value, "supplyid");
            return (Criteria) this;
        }

        public Criteria andSupplyidLessThan(String value) {
            addCriterion("supplyid <", value, "supplyid");
            return (Criteria) this;
        }

        public Criteria andSupplyidLessThanOrEqualTo(String value) {
            addCriterion("supplyid <=", value, "supplyid");
            return (Criteria) this;
        }

        public Criteria andSupplyidLike(String value) {
            addCriterion("supplyid like", value, "supplyid");
            return (Criteria) this;
        }

        public Criteria andSupplyidNotLike(String value) {
            addCriterion("supplyid not like", value, "supplyid");
            return (Criteria) this;
        }

        public Criteria andSupplyidIn(List<String> values) {
            addCriterion("supplyid in", values, "supplyid");
            return (Criteria) this;
        }

        public Criteria andSupplyidNotIn(List<String> values) {
            addCriterion("supplyid not in", values, "supplyid");
            return (Criteria) this;
        }

        public Criteria andSupplyidBetween(String value1, String value2) {
            addCriterion("supplyid between", value1, value2, "supplyid");
            return (Criteria) this;
        }

        public Criteria andSupplyidNotBetween(String value1, String value2) {
            addCriterion("supplyid not between", value1, value2, "supplyid");
            return (Criteria) this;
        }


        public Criteria andSupplynameIsNull() {
            addCriterion("supplyname is null");
            return (Criteria) this;
        }

        public Criteria andSupplynameIsNotNull() {
            addCriterion("supplyname is not null");
            return (Criteria) this;
        }

        public Criteria andSupplynameEqualTo(String value) {
            addCriterion("supplyname =", value, "supplyname");
            return (Criteria) this;
        }

        public Criteria andSupplynameNotEqualTo(String value) {
            addCriterion("supplyname <>", value, "supplyname");
            return (Criteria) this;
        }

        public Criteria andSupplynameGreaterThan(String value) {
            addCriterion("supplyname >", value, "supplyname");
            return (Criteria) this;
        }

        public Criteria andSupplynameGreaterThanOrEqualTo(String value) {
            addCriterion("supplyname >=", value, "supplyname");
            return (Criteria) this;
        }

        public Criteria andSupplynameLessThan(String value) {
            addCriterion("supplyname <", value, "supplyname");
            return (Criteria) this;
        }

        public Criteria andSupplynameLessThanOrEqualTo(String value) {
            addCriterion("supplyname <=", value, "supplyname");
            return (Criteria) this;
        }

        public Criteria andSupplynameLike(String value) {
            addCriterion("supplyname like", value, "supplyname");
            return (Criteria) this;
        }

        public Criteria andSupplynameNotLike(String value) {
            addCriterion("supplyname not like", value, "supplyname");
            return (Criteria) this;
        }

        public Criteria andSupplynameIn(List<String> values) {
            addCriterion("supplyname in", values, "supplyname");
            return (Criteria) this;
        }

        public Criteria andSupplynameNotIn(List<String> values) {
            addCriterion("supplyname not in", values, "supplyname");
            return (Criteria) this;
        }

        public Criteria andSupplynameBetween(String value1, String value2) {
            addCriterion("supplyname between", value1, value2, "supplyname");
            return (Criteria) this;
        }

        public Criteria andSupplynameNotBetween(String value1, String value2) {
            addCriterion("supplyname not between", value1, value2, "supplyname");
            return (Criteria) this;
        }


        public Criteria andThirdname1IsNull() {
            addCriterion("thirdname1 is null");
            return (Criteria) this;
        }

        public Criteria andThirdname1IsNotNull() {
            addCriterion("thirdname1 is not null");
            return (Criteria) this;
        }

        public Criteria andThirdname1EqualTo(String value) {
            addCriterion("thirdname1 =", value, "thirdname1");
            return (Criteria) this;
        }

        public Criteria andThirdname1NotEqualTo(String value) {
            addCriterion("thirdname1 <>", value, "thirdname1");
            return (Criteria) this;
        }

        public Criteria andThirdname1GreaterThan(String value) {
            addCriterion("thirdname1 >", value, "thirdname1");
            return (Criteria) this;
        }

        public Criteria andThirdname1GreaterThanOrEqualTo(String value) {
            addCriterion("thirdname1 >=", value, "thirdname1");
            return (Criteria) this;
        }

        public Criteria andThirdname1LessThan(String value) {
            addCriterion("thirdname1 <", value, "thirdname1");
            return (Criteria) this;
        }

        public Criteria andThirdname1LessThanOrEqualTo(String value) {
            addCriterion("thirdname1 <=", value, "thirdname1");
            return (Criteria) this;
        }

        public Criteria andThirdname1Like(String value) {
            addCriterion("thirdname1 like", value, "thirdname1");
            return (Criteria) this;
        }

        public Criteria andThirdname1NotLike(String value) {
            addCriterion("thirdname1 not like", value, "thirdname1");
            return (Criteria) this;
        }

        public Criteria andThirdname1In(List<String> values) {
            addCriterion("thirdname1 in", values, "thirdname1");
            return (Criteria) this;
        }

        public Criteria andThirdname1NotIn(List<String> values) {
            addCriterion("thirdname1 not in", values, "thirdname1");
            return (Criteria) this;
        }

        public Criteria andThirdname1Between(String value1, String value2) {
            addCriterion("thirdname1 between", value1, value2, "thirdname1");
            return (Criteria) this;
        }

        public Criteria andThirdname1NotBetween(String value1, String value2) {
            addCriterion("thirdname1 not between", value1, value2, "thirdname1");
            return (Criteria) this;
        }


        public Criteria andThirdname2IsNull() {
            addCriterion("thirdname2 is null");
            return (Criteria) this;
        }

        public Criteria andThirdname2IsNotNull() {
            addCriterion("thirdname2 is not null");
            return (Criteria) this;
        }

        public Criteria andThirdname2EqualTo(String value) {
            addCriterion("thirdname2 =", value, "thirdname2");
            return (Criteria) this;
        }

        public Criteria andThirdname2NotEqualTo(String value) {
            addCriterion("thirdname2 <>", value, "thirdname2");
            return (Criteria) this;
        }

        public Criteria andThirdname2GreaterThan(String value) {
            addCriterion("thirdname2 >", value, "thirdname2");
            return (Criteria) this;
        }

        public Criteria andThirdname2GreaterThanOrEqualTo(String value) {
            addCriterion("thirdname2 >=", value, "thirdname2");
            return (Criteria) this;
        }

        public Criteria andThirdname2LessThan(String value) {
            addCriterion("thirdname2 <", value, "thirdname2");
            return (Criteria) this;
        }

        public Criteria andThirdname2LessThanOrEqualTo(String value) {
            addCriterion("thirdname2 <=", value, "thirdname2");
            return (Criteria) this;
        }

        public Criteria andThirdname2Like(String value) {
            addCriterion("thirdname2 like", value, "thirdname2");
            return (Criteria) this;
        }

        public Criteria andThirdname2NotLike(String value) {
            addCriterion("thirdname2 not like", value, "thirdname2");
            return (Criteria) this;
        }

        public Criteria andThirdname2In(List<String> values) {
            addCriterion("thirdname2 in", values, "thirdname2");
            return (Criteria) this;
        }

        public Criteria andThirdname2NotIn(List<String> values) {
            addCriterion("thirdname2 not in", values, "thirdname2");
            return (Criteria) this;
        }

        public Criteria andThirdname2Between(String value1, String value2) {
            addCriterion("thirdname2 between", value1, value2, "thirdname2");
            return (Criteria) this;
        }

        public Criteria andThirdname2NotBetween(String value1, String value2) {
            addCriterion("thirdname2 not between", value1, value2, "thirdname2");
            return (Criteria) this;
        }


        public Criteria andThirdname3IsNull() {
            addCriterion("thirdname3 is null");
            return (Criteria) this;
        }

        public Criteria andThirdname3IsNotNull() {
            addCriterion("thirdname3 is not null");
            return (Criteria) this;
        }

        public Criteria andThirdname3EqualTo(String value) {
            addCriterion("thirdname3 =", value, "thirdname3");
            return (Criteria) this;
        }

        public Criteria andThirdname3NotEqualTo(String value) {
            addCriterion("thirdname3 <>", value, "thirdname3");
            return (Criteria) this;
        }

        public Criteria andThirdname3GreaterThan(String value) {
            addCriterion("thirdname3 >", value, "thirdname3");
            return (Criteria) this;
        }

        public Criteria andThirdname3GreaterThanOrEqualTo(String value) {
            addCriterion("thirdname3 >=", value, "thirdname3");
            return (Criteria) this;
        }

        public Criteria andThirdname3LessThan(String value) {
            addCriterion("thirdname3 <", value, "thirdname3");
            return (Criteria) this;
        }

        public Criteria andThirdname3LessThanOrEqualTo(String value) {
            addCriterion("thirdname3 <=", value, "thirdname3");
            return (Criteria) this;
        }

        public Criteria andThirdname3Like(String value) {
            addCriterion("thirdname3 like", value, "thirdname3");
            return (Criteria) this;
        }

        public Criteria andThirdname3NotLike(String value) {
            addCriterion("thirdname3 not like", value, "thirdname3");
            return (Criteria) this;
        }

        public Criteria andThirdname3In(List<String> values) {
            addCriterion("thirdname3 in", values, "thirdname3");
            return (Criteria) this;
        }

        public Criteria andThirdname3NotIn(List<String> values) {
            addCriterion("thirdname3 not in", values, "thirdname3");
            return (Criteria) this;
        }

        public Criteria andThirdname3Between(String value1, String value2) {
            addCriterion("thirdname3 between", value1, value2, "thirdname3");
            return (Criteria) this;
        }

        public Criteria andThirdname3NotBetween(String value1, String value2) {
            addCriterion("thirdname3 not between", value1, value2, "thirdname3");
            return (Criteria) this;
        }


        public Criteria andThirdname4IsNull() {
            addCriterion("thirdname4 is null");
            return (Criteria) this;
        }

        public Criteria andThirdname4IsNotNull() {
            addCriterion("thirdname4 is not null");
            return (Criteria) this;
        }

        public Criteria andThirdname4EqualTo(String value) {
            addCriterion("thirdname4 =", value, "thirdname4");
            return (Criteria) this;
        }

        public Criteria andThirdname4NotEqualTo(String value) {
            addCriterion("thirdname4 <>", value, "thirdname4");
            return (Criteria) this;
        }

        public Criteria andThirdname4GreaterThan(String value) {
            addCriterion("thirdname4 >", value, "thirdname4");
            return (Criteria) this;
        }

        public Criteria andThirdname4GreaterThanOrEqualTo(String value) {
            addCriterion("thirdname4 >=", value, "thirdname4");
            return (Criteria) this;
        }

        public Criteria andThirdname4LessThan(String value) {
            addCriterion("thirdname4 <", value, "thirdname4");
            return (Criteria) this;
        }

        public Criteria andThirdname4LessThanOrEqualTo(String value) {
            addCriterion("thirdname4 <=", value, "thirdname4");
            return (Criteria) this;
        }

        public Criteria andThirdname4Like(String value) {
            addCriterion("thirdname4 like", value, "thirdname4");
            return (Criteria) this;
        }

        public Criteria andThirdname4NotLike(String value) {
            addCriterion("thirdname4 not like", value, "thirdname4");
            return (Criteria) this;
        }

        public Criteria andThirdname4In(List<String> values) {
            addCriterion("thirdname4 in", values, "thirdname4");
            return (Criteria) this;
        }

        public Criteria andThirdname4NotIn(List<String> values) {
            addCriterion("thirdname4 not in", values, "thirdname4");
            return (Criteria) this;
        }

        public Criteria andThirdname4Between(String value1, String value2) {
            addCriterion("thirdname4 between", value1, value2, "thirdname4");
            return (Criteria) this;
        }

        public Criteria andThirdname4NotBetween(String value1, String value2) {
            addCriterion("thirdname4 not between", value1, value2, "thirdname4");
            return (Criteria) this;
        }


        public Criteria andThirdname5IsNull() {
            addCriterion("thirdname5 is null");
            return (Criteria) this;
        }

        public Criteria andThirdname5IsNotNull() {
            addCriterion("thirdname5 is not null");
            return (Criteria) this;
        }

        public Criteria andThirdname5EqualTo(String value) {
            addCriterion("thirdname5 =", value, "thirdname5");
            return (Criteria) this;
        }

        public Criteria andThirdname5NotEqualTo(String value) {
            addCriterion("thirdname5 <>", value, "thirdname5");
            return (Criteria) this;
        }

        public Criteria andThirdname5GreaterThan(String value) {
            addCriterion("thirdname5 >", value, "thirdname5");
            return (Criteria) this;
        }

        public Criteria andThirdname5GreaterThanOrEqualTo(String value) {
            addCriterion("thirdname5 >=", value, "thirdname5");
            return (Criteria) this;
        }

        public Criteria andThirdname5LessThan(String value) {
            addCriterion("thirdname5 <", value, "thirdname5");
            return (Criteria) this;
        }

        public Criteria andThirdname5LessThanOrEqualTo(String value) {
            addCriterion("thirdname5 <=", value, "thirdname5");
            return (Criteria) this;
        }

        public Criteria andThirdname5Like(String value) {
            addCriterion("thirdname5 like", value, "thirdname5");
            return (Criteria) this;
        }

        public Criteria andThirdname5NotLike(String value) {
            addCriterion("thirdname5 not like", value, "thirdname5");
            return (Criteria) this;
        }

        public Criteria andThirdname5In(List<String> values) {
            addCriterion("thirdname5 in", values, "thirdname5");
            return (Criteria) this;
        }

        public Criteria andThirdname5NotIn(List<String> values) {
            addCriterion("thirdname5 not in", values, "thirdname5");
            return (Criteria) this;
        }

        public Criteria andThirdname5Between(String value1, String value2) {
            addCriterion("thirdname5 between", value1, value2, "thirdname5");
            return (Criteria) this;
        }

        public Criteria andThirdname5NotBetween(String value1, String value2) {
            addCriterion("thirdname5 not between", value1, value2, "thirdname5");
            return (Criteria) this;
        }


        public Criteria andLikeQuery(RpaMidSupply record) {
            List<String> list = new ArrayList<String>();
            List<String> list2 = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
            if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                list.add("ifnull(id,'')");
            }
            if (record.getSupplyid() != null && StrUtil.isNotEmpty(record.getSupplyid().toString())) {
                list.add("ifnull(supplyid,'')");
            }
            if (record.getSupplyname() != null && StrUtil.isNotEmpty(record.getSupplyname().toString())) {
                list.add("ifnull(supplyname,'')");
            }
            if (record.getThirdname1() != null && StrUtil.isNotEmpty(record.getThirdname1().toString())) {
                list.add("ifnull(thirdname1,'')");
            }
            if (record.getThirdname2() != null && StrUtil.isNotEmpty(record.getThirdname2().toString())) {
                list.add("ifnull(thirdname2,'')");
            }
            if (record.getThirdname3() != null && StrUtil.isNotEmpty(record.getThirdname3().toString())) {
                list.add("ifnull(thirdname3,'')");
            }
            if (record.getThirdname4() != null && StrUtil.isNotEmpty(record.getThirdname4().toString())) {
                list.add("ifnull(thirdname4,'')");
            }
            if (record.getThirdname5() != null && StrUtil.isNotEmpty(record.getThirdname5().toString())) {
                list.add("ifnull(thirdname5,'')");
            }
            if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                list2.add("'%" + record.getId() + "%'");
            }
            if (record.getSupplyid() != null && StrUtil.isNotEmpty(record.getSupplyid().toString())) {
                list2.add("'%" + record.getSupplyid() + "%'");
            }
            if (record.getSupplyname() != null && StrUtil.isNotEmpty(record.getSupplyname().toString())) {
                list2.add("'%" + record.getSupplyname() + "%'");
            }
            if (record.getThirdname1() != null && StrUtil.isNotEmpty(record.getThirdname1().toString())) {
                list2.add("'%" + record.getThirdname1() + "%'");
            }
            if (record.getThirdname2() != null && StrUtil.isNotEmpty(record.getThirdname2().toString())) {
                list2.add("'%" + record.getThirdname2() + "%'");
            }
            if (record.getThirdname3() != null && StrUtil.isNotEmpty(record.getThirdname3().toString())) {
                list2.add("'%" + record.getThirdname3() + "%'");
            }
            if (record.getThirdname4() != null && StrUtil.isNotEmpty(record.getThirdname4().toString())) {
                list2.add("'%" + record.getThirdname4() + "%'");
            }
            if (record.getThirdname5() != null && StrUtil.isNotEmpty(record.getThirdname5().toString())) {
                list2.add("'%" + record.getThirdname5() + "%'");
            }
            buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append(" like CONCAT(");
            buffer.append(StrUtil.join(",", list2));
            buffer.append(")");
            if (!" CONCAT() like CONCAT()".equals(buffer.toString())) {
                addCriterion(buffer.toString());
            }
            return (Criteria) this;
        }

        public Criteria andLikeQuery2(String searchText) {
            List<String> list = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
            list.add("ifnull(id,'')");
            list.add("ifnull(supplyid,'')");
            list.add("ifnull(supplyname,'')");
            list.add("ifnull(thirdname1,'')");
            list.add("ifnull(thirdname2,'')");
            list.add("ifnull(thirdname3,'')");
            list.add("ifnull(thirdname4,'')");
            list.add("ifnull(thirdname5,'')");
            buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append("like '%");
            buffer.append(searchText);
            buffer.append("%'");
            addCriterion(buffer.toString());
            return (Criteria) this;
        }

    }

    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}